import request from '@/axios'
import { CurdData } from './types'

export const getListApi = (params: any) => {
  return request.get({ url: '/admin/operator', params })
}
export const getSelectListApi = (params: any) => {
  return request.get({ url: '/admin/operator/select', params })
}

export const saveApi = (data: Partial<CurdData>): Promise<IResponse> => {
  if (data.id) {
    return request.put({ url: '/admin/operator', data })
  } else {
    return request.post({ url: '/admin/operator', data })
  }
}
// 员工信息-销售人员信息
export const getarticleListApi = (params: any) => {
  return request.get({ url: '/admin/article', params })
}
export const getarticleAddApi = (params: any) => {
  return request.post({ url: '/admin/article', data: params })
}
export const getarticleEditApi = (params: any) => {
  return request.put({ url: '/admin/article', data: params })
}
export const getarticleDelApi = (params: any) => {
  return request.delete({ url: '/admin/article', data: params })
}
export const getEnumApi = (params?: any) => {
  return request.get({ url: '/admin/article/fieldEnum', params })
}
